﻿<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<c:set var="basePath" value="${pageContext.request.contextPath}"/>
<!DOCTYPE HTML>
<html lang="zh-cn">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>日志管理</title>
	<jsp:include page="/resources/inc/head.jsp" />
</head>
<body>
<div id="main">
	<div class="layui-btn-group demoTable">
		<shiro:hasPermission name="upms:log:delete">
		<button class="layui-btn" onclick="Common.batchDelete({url:'${basePath}/manage/log/delete',id:'logId'})">删除日志</button>
		</shiro:hasPermission>
	</div>
	<table id="table"></table>
</div>
<jsp:include page="/resources/inc/footer.jsp" />
<script>
	//第一个实例
	table.render({
		elem: '#table',
		height: "full-80",
		url: '${basePath}/manage/log/list', //数据接口
		page: true, //开启分页
		request: {
			pageName: 'pageNumber', //页码的参数名称，默认：page
			limitName: 'pageSize' //每页数据量的参数名，默认：limit
		},
		response: {
			statusCode: 200, //成功的状态码，默认：0
			countName: 'total', //数据总数的字段名称，默认：count
			dataName: 'rows' //数据列表的字段名称，默认：data
		},
		cols: [[ //表头
			{type:'checkbox'},
			{field: 'logId', title: '编号', sort: true, align: 'center'},
			{field: 'description', title: '操作'},
			{field: 'username', title: '操作用户'},
			{field: 'startTime', title: '操作时间',templet:function (d) {return dateFormatter(d.startTime)}},
			{field: 'spendTime', title: '耗时'},
			{field: 'url', title: '请求路径'},
			{field: 'method', title: '请求类型'},
			{field: 'parameter', title: '请求参数'},
			{field: 'userAgent', title: '用户标识'},
			{field: 'ip', title: 'IP地址'},
			{field: 'permissions', title: '权限值'}
		]]
	});

</script>
</body>
</html>